<?php
class ModelModuleGoogleIdentityToolkit extends Model{
	public function install() {
		$query = $this->db->query ( "DESC " . DB_PREFIX . "customer" );
		$fields = array ();
		foreach ( $query->rows as $table ) {
			$field = $table ['Field'];
			$fields [$field] = true;
		}
		if (empty ( $fields ['type'] )) {
			$this->db->query ( "ALTER TABLE " . DB_PREFIX . "customer ADD (type int(1) NOT NULL DEFAULT '0')" );
		}
	}
	
	public function uninstall() {
		$query = $this->db->query ( "DESC " . DB_PREFIX . "customer" );
		$fields = array ();
		foreach ( $query->rows as $table ) {
			$field = $table ['Field'];
			$fields [$field] = true;
		}
		if (!empty ( $fields ['type'] )) {
			$this->db->query ( "ALTER TABLE " . DB_PREFIX . "customer drop type" );
		}
	}
}

?>